﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using qiupeng.Public;
using System.IO;
namespace qphr.OpenWindows
{
    public partial class open_SysData : System.Web.UI.Page
    {
        Db List = new Db();
        public static string type, typename;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                name.Attributes["onkeydown"] = "if (event.keyCode==13) { document.all.Button4.click(); return false;}";
            }

            if (!Page.IsPostBack)
            {
                type = base.Request.QueryString["type"].ToString();
                if (type == "1")
                {
                    typename = "学历";
                }
                if (type == "2")
                {
                    typename = "事故类型";
                }
                if (type == "3")
                {
                    typename = "执业资格";
                }
                if (type == "4")
                {
                    typename = "工资项目";
                }
                if (type == "5")
                {
                    typename = "班次类型";
                }
                if (type == "6")
                {
                    typename = "休假类型";
                }
                if (type == "7")
                {
                    typename = "伤害部位";
                }
                if (type == "8")
                {
                    typename = "婚姻状况";
                }
                if (type == "9")
                {
                    typename = "健康状况";
                }
                if (type == "10")
                {
                    typename = "伤害程度";
                }
                if (type == "11")
                {
                    typename = "协议类型";
                }
                if (type == "12")
                {
                    typename = "在职状态";
                }
                if (type == "13")
                {
                    typename = "事故级别";
                }
                if (type == "14")
                {
                    typename = "课件类别";
                }
                if (type == "15")
                {
                    typename = "非伤亡事故类别";
                }
                if (type == "16")
                {
                    typename = "人才等级";
                }
                if (type == "17")
                {
                    typename = "培训类型";
                }
                if (type == "18")
                {
                    typename = "流程操作";
                }
                if (type == "19")
                {
                    typename = "招聘来源";
                }
                if (type == "20")
                {
                    typename = "面试方式";
                }
                if (type == "21")
                {
                    typename = "行业性质";
                }
                if (type == "22")
                {
                    typename = "企业性质";
                }
                if (type == "23")
                {
                    typename = "合同变更";
                }
                if (type == "24")
                {
                    typename = "奖励项目";
                }
                if (type == "25")
                {
                    typename = "处分项目";
                }
                if (type == "26")
                {
                    typename = "离职原因";
                }
                if (type == "27")
                {
                    typename = "人才分类";
                }
                if (type == "28")
                {
                    typename = "管理级别";
                }
                if (type == "29")
                {
                    typename = "籍贯";
                }
                if (type == "30")
                {
                    typename = "初选方式";
                }
                if (type == "31")
                {
                    typename = "培训计划年份";
                }
                if (type == "32")
                {
                    typename = "培训方式";
                }
                if (type == "33")
                {
                    typename = "课件类别";
                }
                if (type == "34")
                {
                    typename = "授课方式";
                }
                if (type == "35")
                {
                    typename = "培训方法";
                }
                if (type == "36")
                {
                    typename = "协议类型";
                }
                if (type == "37")
                {
                    typename = "培训协议年份";
                }
                if (type == "38")
                {
                    typename = "事故类别";
                }
                if (type == "39")
                {
                    typename = "合同类型";
                }
                if (type == "40")
                {
                    typename = "合同解除类别";
                }
                if (type == "41")
                {
                    typename = "合同恢复类别";
                }
                if (type == "42")
                {
                    typename = "合同试用类别";
                }
                if (type == "43")
                {
                    typename = "合同转正类别";
                }
                if (type == "44")
                {
                    typename = "合同变更类别";
                }
                if (type == "45")
                {
                    typename = "合同续签类别";
                }
                if (type == "46")
                {
                    typename = "三违种类";
                }
                if (type == "47")
                {
                    typename = "员工工种";
                }
                if (type == "48")
                {
                    typename = "调动类型";
                }
                if (type == "49")
                {
                    typename = "离职类型";
                }
                if (type == "50")
                {
                    typename = "复职类型";
                }
                if (type == "51")
                {
                    typename = "证照类型";
                }
                if (type == "52")
                {
                    typename = "发证机构";
                }
                if (type == "53")
                {
                    typename = "职称取得方式";
                }
                if (type == "54")
                {
                    typename = "考核类型";
                }
                if (type == "55")
                {
                    typename = "考核期间";
                }
                if (type == "56")
                {
                    typename = "开户行";
                }
                if (type == "57")
                {
                    typename = "职位类别";
                }
                if (type == "98")
                {
                    typename = "政治面貌";
                }
                if (type == "97")
                {
                    typename = "员工岗位";
                }
                if (type == "96")
                {
                    typename = "员工职务";
                }
                if (type == "95")
                {
                    typename = "员工职称";
                }
                this.BindAttribute();
                this.DataBindToGridview("order by id asc");
                this.Bindquanxian();




            }
            DataBindToGridview("");
        }

        public void DataBindToGridview(string str)
        {
            //if (Request.QueryString["str"] != null)
            //{
            string SQL_GetList_xs = "select * from qp_hr_SysData where type='" + Request.QueryString["type"] + "' " + str + "";
            GridView1.DataSource = List.GetGrid_Pages_not(SQL_GetList_xs);
            GridView1.DataBind();

            //}
            //else
            //{
            //    string SQL_GetList_xs = "select * from qp_SaleData where type='" + Request.QueryString["type"] + "'  ";
            //    GridView1.DataSource = List.GetGrid_Pages_not(SQL_GetList_xs);
            //    GridView1.DataBind();

            //}


        }
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            this.GridView1.PageIndex = e.NewPageIndex;
            DataBindToGridview("");
            this.GridView1.DataBind();
        }

        protected void Button4_Click(object sender, EventArgs e)
        {

            DataBindToGridview("and  name like '%" + name.Text + "%'");
        }
    }
}
